package com.msmall.community.roster.model;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import com.msmall.base.model.BaseObject;

/**
 * 好友组所有的好友
 */
@Entity
@Table(name="base_user_roster")
public class Roster extends BaseObject{

	private static final long serialVersionUID = -2024216079815136724L;

	@Id
	@Column(name="rosterid",insertable=false,updatable=false)
	@GeneratedValue(strategy=GenerationType.AUTO)
	private Long rosterid;
	
	/**
	 * 好友ID
	 */
	@Column(name="userid")
	private Long userid;
	
	/**
	 * 用户给好友的备注
	 */
	@Column(name="nickname")
	private String nickname;
	
	/**
	 * 此组拥有者对好友的关系
	 * 值=1：请求;值=2同意；值=-1未处理；值=-2黑名单；值=-3拒绝
	 */
	@Column(name="status")
	private Integer status;
	
	@ManyToOne(cascade={CascadeType.PERSIST,CascadeType.MERGE}, fetch=FetchType.EAGER)
	@JoinColumn(name="groupid")
	private RosterGroup group;

	public Long getRosterid() {
		return rosterid;
	}

	public void setRosterid(Long rosterid) {
		this.rosterid = rosterid;
	}

	public Long getUserid() {
		return userid;
	}

	public void setUserid(Long userid) {
		this.userid = userid;
	}

	public String getNickname() {
		return nickname;
	}

	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public RosterGroup getGroup() {
		return group;
	}

	public void setGroup(RosterGroup group) {
		this.group = group;
	}

	@Override
	public boolean equals(Object o) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public int hashCode() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return null;
	}

}
